package com.atguigu.gmall.wms.mapper;

import com.atguigu.gmall.wms.entity.WareSkuEntity;
import com.atguigu.gmall.wms.entity.WmsWareSkuEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * 商品库存
 * 
 * @author fengge
 * @email fengge@atguigu.com
 * @date 2021-08-31 15:09:14
 */
@Mapper
public interface WmsWareSkuMapper extends BaseMapper<WmsWareSkuEntity> {

    List<WareSkuEntity> getSkuWare(@Param("skuId") Long skuId,@Param("count") Integer count);

    int lock(@Param("skuId") Long skuId,@Param("count") Integer count,@Param("wareId") Long wareId);

    void unLock(@Param("skuId")Long skuId,@Param("wareId") Long wareId, @Param("count")Integer count);

    void minus(@Param("id") Long wareId, @Param("count") Integer count);
}
